#!/bin/bash
#2020年2月10日22:00:30
#auto install nginx web
#by author www.jfedu.net
#####################
yum install -y gcc pcre pcre-devel zlib zlib-devel wget make openssl-devel net-tools openssl
wget -c http://nginx.org/download/nginx-1.26.2.tar.gz
tar -xzvf nginx-1.26.2.tar.gz
cd nginx-1.26.2
useradd -s /sbin/nologin www -M
./configure --prefix=/usr/local/nginx --user=www --group=www \
	--sbin-path=/usr/local/nginx/sbin/nginx \
	--conf-path=/usr/local/nginx/conf/nginx.conf \
	--error-log-path=/usr/local/nginx/logs/error.log \
	--http-log-path=/usr/local/nginx/logs/access.log \
	--pid-path=/usr/local/nginx/logs/nginx.pid \
	--lock-path=/var/lock/subsys/nginx \
	--with-http_stub_status_module \
	--with-http_ssl_module \
	--with-http_gzip_static_module \
	--with-pcre
make
make install
/usr/local/nginx/sbin/nginx
ps -ef|grep nginx
netstat -ntlp|grep 80
setenforce 0
getenforce 0
systemctl stop firewalld.service
